package org.restbox.core.base.service;

import org.restbox.core.dao.UserDAO;
import org.restbox.core.entity.User;
import org.restbox.core.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * User management service
 *
 * @author troig
 */
@Component()
public class BaseUserService implements UserService {

   /** User DAO */
   @Autowired
   UserDAO userDAO;

   /**
    * Get user by <tt>email</tt>
    *
    * @param mail User email
    * @return User
    */
   @Override
   public User getUserByMail(String mail) {
      return userDAO.findByKey(mail);
   }
}

